package com.owc.domain.vo.app;

import com.owc.common.custom.annotation.IsPhone;
import com.owc.common.enums.LoginTypeEnum;
import lombok.Data;

import javax.validation.constraints.NotNull;

/**
 * @Author Jackies
 * @Date 2019/12/3 20:11
 * @Description TODO://
 **/
@Data
public class LoginVo {

    @NotNull(message = "Please enter the phone number")
    @IsPhone
    private String phone;

    /**
     * 1(验证码登录)  2(密码登录)
     */
    @NotNull(message = "Missing required parameter")
    private Integer type;

    private String authCode;

    private String password;

    public LoginVo(@IsPhone String phone, @NotNull(message = "password field must not be null") String password) {
        this.phone = phone;
        this.password = password;
        //Default use password the wat login.
        this.type = LoginTypeEnum.PASSWORD_TYPE.getType();
    }
}
